package site.teamo.biu.net.common.util;

import io.netty.channel.Channel;
import io.netty.channel.ChannelPipeline;

/**
 * @author haocongshun
 * @date 2023/03/03 15:47:07
 */
public class NettyUtil {
    private NettyUtil() throws IllegalAccessException {
        throw new IllegalAccessException("NettyUtil 不支持实例化");
    }

    public static String printPipeline(Channel channel) {
        ChannelPipeline pipeline = channel.pipeline();
        StringBuilder sb = new StringBuilder();
        pipeline.forEach(handler -> sb.append(handler.getKey()).append(" -> "));
        sb.append("END");
        return sb.toString();
    }
}
